package com.atguigu.cloud.apis;

import com.atguigu.cloud.entities.PayDTO;
import com.atguigu.cloud.resp.ResultData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author yuanx
 * @date 2024/3/13 0:03
 */

//@FeignClient(value = "cloud-payment-service")
@FeignClient(value = "cloud-gateway")
public interface PayFeignApi {

    @PostMapping("/pay/add")
    public ResultData<String> add(@RequestBody PayDTO pay);

    @GetMapping("/pay/getById/{id}")
    public ResultData selectPayById(@PathVariable("id") Integer id);

    @GetMapping("/pay/getInfoByConsul")
    public String getlb();

    @GetMapping("/pay/getAll")
    public ResultData getAll();

    @GetMapping("/pay/circuit/{id}")
    public String getCircuit(@PathVariable("id") Integer id);


    @GetMapping("/pay/bulkhead/{id}")
    public String getBulkhead(@PathVariable("id") Integer id);

    /**
     * Resilience4j Ratelimit 的例子
     * @param id
     * @return
     */
    @GetMapping(value = "/pay/ratelimit/{id}")
    public String myRatelimit(@PathVariable("id") Integer id);

    @GetMapping(value = "/pay/micrometer/{id}")
    public String myMicrometer(@PathVariable("id") Integer id);

    @GetMapping(value = "/pay/gateway/get/{id}")
    public ResultData getById(@PathVariable("id") Integer id);

    @GetMapping(value = "/pay/gateway/info")
    public ResultData<String> getGatewayInfo();



}
